bt(void).
bt(tree(Element,Left,Right)):-bt(Left),bt(Right).
	
hanoi(s(0),A,B,C,[A, to, B]).
hanoi(s(N),A,B,C,Moves):-
  hanoi(N,A,C,B,Ms1),
  hanoi(N,C,B,A,Ms2),
  append(Ms1,[A, to, B|Ms2],Moves).
